Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add release-please action for releasing to RubyGems #14

Merged
merged 1 commit into from
Apr 3, 2022
Merged

build: add release-please action for releasing to RubyGems #14

merged 1 commit into from
Apr 3, 2022

Conversation

andrewmcodes
Copy link
Contributor

In this commit we set up the google-github-actions/release-please-action, which uses googleapis/release-please under the hood.

This enables automatic deployment and versioning, and all you have to do is have good commit messages 😉

All jokes aside, the real power of this action can be achieved when you use conventional commits. Luckily there are only 2 important prefixes (3 if you want consistency)

  • feat:: commit messages prefixed with feat: will cause the action to create a minor version release PR for you to review.
  • fix:: prefixing with fix: will create a patch upgrade
  • chore: is the same as not doing any prefix. It is basically a way to say it does not affect the core library code.

Lastly, if you add a ! for feat!:, and same with fix, it is seen as a breaking change and will create a major version release.

To be clear, you don't actually have to change your commit message patterns to use this. There are other ways to tell the action what version it should be bumping to but this won't generate a good changelog for you, and it may lead to not adhering as strictly to SEMVER.

To release with a different version than the one the PR is currently for, you can add a commit with the following in the Body:

Release-As: 2.0.0

source

If you wanted to get the Changelog correct, you also have the option to modify old commit message bodies with a special block of text that the action will see and update your changelog accordingly.


Once you understand it, you will likely never have to change it again. A little behavior change upfront is imo an amazing tradeoff for never having to remember how to release the gem 2 odd years later.

BUT it's not for everyone so 🔥burn it with fire🔥 if it doesn't work for you 🙂

@DRBragg
Copy link
Owner

DRBragg commented Apr 3, 2022

This is awesome! Thanks for this!

@DRBragg DRBragg merged commit 3367a76 into DRBragg:main Apr 3, 2022
@andrewmcodes andrewmcodes deleted the add-release-please branch April 3, 2022 01:05
Copy link
Owner

@DRBragg DRBragg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants